#ifndef COMMENT_IDENTIFIER_STRUCT_HH
#define COMMENT_IDENTIFIER_STRUCT_HH 1


#include <string>
#include <iostream>
#include <vector>
#include "otl8.hpp"

static const char*  comment_identifier_struct_s = "SELECT ID, VALUE FROM COMMENT_IDENTIFIER_STRUCT";

static const char*  comment_identifier_struct_i = "INSERT INTO COMMENT_IDENTIFIER_STRUCT ( ID, VALUE )VALUES(:f1<int>, :f2<char[128]>)";

static const char* comment_identifier_struct_c = "CREATE TABLE COMMENT_IDENTIFIER_STRUCT ( ID INTEGER , VALUE VARCHAR(128) )";
class comment_identifier_struct
{



public:
comment_identifier_struct():_id(0), _value(""){_select=comment_identifier_struct_s;_insert=comment_identifier_struct_i;_create=comment_identifier_struct_c;}


comment_identifier_struct(int a__id, std::string a__value):_id(a__id) , _value(a__value) {_select=comment_identifier_struct_s;_insert=comment_identifier_struct_i;_create=comment_identifier_struct_c;}


int id(){return  _id;}
void set_id(int a__id){ _id = a__id;}


std::string value(){return  _value;}
void set_value(std::string a__value){ _value = a__value;}


comment_identifier_struct & operator=( const comment_identifier_struct & x)
{
	_id =  x._id;
	_value =  x._value;
	return *this;
}


bool operator==( const comment_identifier_struct & x)
{
	return 	_id ==  x._id &&
	_value ==  x._value;
}


friend std::istream& operator >> (std::istream& ist, comment_identifier_struct & t)
{
	if (!(ist >> t._id)) return ist;
	if (!(ist >> t._value)) return ist;

	return ist;
}

friend std::ostream& operator << (std::ostream& ost, comment_identifier_struct & t)
{
	ost << t._id << " ";
	ost << t._value << " ";

	return ost;
}
/*
friend otl_stream& operator >> (otl_stream& ist, comment_identifier_struct & t)
{
	ist >> t._id;
	ist >> t.buf; t._value=(const char*)t.buf;

	return ist;
}

friend otl_stream& operator << (otl_stream& ost, comment_identifier_struct & t)
{
	ost << t._id ;
	ost << t._value.c_str() ;

	return ost;
}
*/
std::string select_stmt() { return _select; }
std::string insert_stmt() { return _insert; }
std::string create_stmt() { return _create; }


private:

	int	_id;
	std::string	_value;
	std::string _create;
	std::string _select;
	std::string _insert;
char buf[128];
};
#endif
